package dao;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import org.springframework.orm.ibatis.SqlMapClientTemplate;

import vo.MemberVO;

public class MemberDAO {
	
	private SqlMapClientTemplate client;
	public void setSqlMapClientTemplate(SqlMapClientTemplate client) {
		this.client = client;
	}
	
	public void insert(MemberVO mvo){
		client.insert("member.MemberInsert", mvo);
	}
	public MemberVO SearchMemberId(String member_id){
		System.out.println("dao" + member_id);
		return (MemberVO)client.queryForObject("member.SearchMemberId", member_id);
	}
	public MemberVO SearchMemberPassword(String password){
		return (MemberVO)client.queryForObject("member.SearchMemberPassword", password);
	}
	public void UpdateMember(MemberVO mvo){
		client.update("member.UpdateMember", mvo);
	}
	public void UpdateMemerberType(HashMap map){
		client.update("member.UpdateMemerType", map);
	}
	public void DeleteMember(String member_id){
		client.delete("member.DeleteMember", member_id);
	}
	public String SearchMyMember_id(HashMap map){
		return (String)client.queryForObject("member.SearchMyMember_id", map);
	}
	public String SearchMyPassword(HashMap map){
		return (String)client.queryForObject("member.SearchMyPassword", map);
	}
	public int getTotalCount(){
		return(Integer)client.queryForObject("member.TotalCount", null);
	}
	public ArrayList<MemberVO> getMemberList(int page){
		return(ArrayList<MemberVO>)client.queryForList("member.ShowMemberList", page);
	}
}
